// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

 // create tab group
var tabGroup = Titanium.UI.createTabGroup(
{
    barColor: '#336699'
});

//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
    title: 'Users',
    url: "users.js"
});
var tab1 = Titanium.UI.createTab({
icon: 'images/address_32.png',
    title: 'DNN Users',
    window: win1
});

// Create the window for roles
var win2 = Titanium.UI.createWindow({
    title: "Roles", // Set the title
    url: "roles.js" // Link to file which will handle the code for the window
});

// Create the tab for roles
var tab2 = Titanium.UI.createTab({
    title: "DNN Roles", // Title of the tab: "Twitter"
    icon: "images/globe_32.png", // Icon for tab : Included in the source files
    window: win2 // We will create the window "mainWin"
});

// Add the tab to our tab group
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);

tabGroup.open();